//
//  PhotoCameraOverlayView.m
//  XPhoto
//
//  Created by baboy on 2019/6/10.
//  Copyright © 2019 baboy. All rights reserved.
//

#import "PhotoCameraOverlayView.h"

@implementation PhotoCameraOverlayView
- (void)awakeFromNib{
    [super awakeFromNib];
    self.dialPlateView.items = @[
        @{
            @"title":@"拍照"
        },
        @{
            @"title":@"拍视频"
        }
    ];
    self.dialPlateView.selectedIndex = 0;
}
- (void)layoutSubviews{
    [super layoutSubviews];
}

#pragma button actions

- (IBAction)nextStep:(id)button{
    if (self.delegate && [self.delegate respondsToSelector:@selector(overlayView:clickNextButton:)]) {
        [self.delegate overlayView:self clickNextButton:button];
    }
}
- (IBAction)cancel:(id)button{
    if (self.delegate && [self.delegate respondsToSelector:@selector(overlayView:clickCancelButton:)]) {
        [self.delegate overlayView:self clickCancelButton:button];
    }
    
}
- (IBAction)changeCamera:(id)button{
    if (self.delegate && [self.delegate respondsToSelector:@selector(overlayView:clickDeviceButton:)]) {
        [self.delegate overlayView:self clickDeviceButton:button];
    }

}
- (IBAction)takePhoto:(id)button{
    if (self.delegate && [self.delegate respondsToSelector:@selector(overlayView:clickTakePhotoButton:)]) {
        [self.delegate overlayView:self clickTakePhotoButton:button];
    }
}
- (IBAction)preview:(id)button{
    self.previewContainer.hidden = !self.previewContainer.hidden;
    if (self.delegate && [self.delegate respondsToSelector:@selector(overlayView:clickPreviewButton:)]) {
        [self.delegate overlayView:self clickPreviewButton:button];
    }
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
